import { Base } from '../../utils/base.js'

class Refund extends Base {

  constructor() {
    super();
  }

  /*退款订单*/
  getOrdersRufund(param, callback) {
    var allParams = {
      url: 'order/list?page=' + param.page,
      data: {},
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  //售后申请记录
  getLog(param, callback) {
    var allParams = {
      url: 'service/index?page=' + param.page +'&expand=orderSku',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  /*获取SKU信息*/
  getSkuInfo(param, callback) {
    var allParams = {
      url: 'service/info',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  //提交退货申请
  applyService(param, callback) {
    var allParams = {
      url: 'order/apply-service',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
 
  //提交换货申请
  applyExchange(param, callback) {
    var allParams = {
      url: 'order/apply-exchange',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  //服务单详情
  info(param, callback) {
    var allParams = {
      url: 'service/process',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  //快递公司列表
  expressCompany(param, callback) {
    var allParams = {
      url: 'order/company',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  //填写发货单
  fahuo(param, callback) {
    var allParams = {
      url: 'order/send',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
}

export { Refund };